package com.itheima.d2_upd1.ZengUdpTest;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;

/**
 * @ClassName Client
 * @Author 16799
 * @Date 2025/9/24 23:21
 * @Version 1.0
 * @Description TODO
 **/
public class Client {
    public static void main(String[] args) throws Exception {
        DatagramSocket socket = new DatagramSocket(7711);

        byte[] bytes = "曾季洪比阿炮牛逼亿点点".getBytes();
        DatagramPacket packet = new DatagramPacket(bytes,
                bytes.length, InetAddress.getLocalHost(),
                7722);

        socket.send(packet);
        System.out.println("客户端已经发送数据包");
        socket.close();
    }
}
